package main.flex.component.main.tooltip
{
	import flash.filters.GlowFilter;
	
	import main.flex.conf.MainConf;
	import main.flex.utils.EmbeddedMedia;
	
	import mx.containers.Box;
	import mx.containers.BoxDirection;
	import mx.controls.Image;
	import mx.controls.Text;
	import mx.core.IToolTip;

	public class FlexAnimatedCatTooltip extends Box implements IToolTip
	{
		private var image 		: Image;
		private var _text		: String;
		private var textHolder	: Text;
		
		public function FlexAnimatedCatTooltip()
		{
			mouseEnabled 	= false;
            mouseChildren	= false;
			
            setStyle("paddingLeft", 15);
            setStyle("paddingTop", 15);
            setStyle("paddingBottom", 15);
            setStyle("paddingRight", 15);
            setStyle('verticalAlign','middle');
            
            direction = BoxDirection.HORIZONTAL;
			
			maxWidth = 600;
			
			autoLayout = true;
			horizontalScrollPolicy = "off";
			verticalScrollPolicy = "off";
			
			// Ajout d'un effet autour de la bulle
            filters=[new GlowFilter(MainConf.COLOR_BASE_BLUE,.2,8,8)];
		}
		
		public function get text() : String
		{     
            return _text;
        }
        
        public function set text( value : String ) : void
        {
            _text = value;
        }
		
		override protected function createChildren() : void
		{
            super.createChildren();
           /*  
            image = new Image;
            image.source = EmbeddedMedia.getInstance().tooltip_info;
            image.scaleX = .2;
            image.scaleY = .2;
            addChild( image ); */
            
            
            textHolder = new Text;
            textHolder.percentWidth = 100;
            textHolder.text = _text;
            textHolder.setStyle('color', MainConf.COLOR_VERY_DARK_GREY);
            textHolder.setStyle('fontWeight', 'bold');
            textHolder.setStyle('fontFamily','Verdana');
            textHolder.setStyle('fontSize',20);
            addChild(textHolder);
            
            setStyle('backgroundColor',0xFFFFFF);
            setStyle('backgroundAlpha',1);
            setStyle('borderStyle','solid');
            setStyle('borderThickness',1.4);
            setStyle('borderColor',MainConf.COLOR_BASE_BLUE);
            setStyle('cornerRadius',40);
        }
	}
}